﻿@model MovieTheatherApp.Models.MovieDetailsVM

<div class="container">
    <div class="row">

        <div class="col-sm-3">
            <img class="img-responsive" src="@Model.Movie.Poster" />
        </div>
        <div class="col-sm-9">
            <h2>@Model.Movie.Title</h2>
            <h4>Rated @Model.Movie.Rating</h4>
        </div>

    </div>
    <button class="btn btn-primary pull-right" onclick="location.href='/Home/AddReview/@Model.Movie.Id'">Add Review</button>
    <button class="btn btn-primary pull-right" onclick="location.href='/Home/UpdateMovie/@Model.Movie.Id'">Update Movie</button>
    <form method="post" action="/Home/DeleteMovie">
        <input type="hidden" name="id" value="@Model.Movie.Id" />
        <input class="btn btn-danger pull-right" type="submit" value="Delete Movie" />
    </form>
    <div class="row">
        <table class="table table-hover">
            <tr>
                <th>Review Title</th>
                <th>Review Comment</th>
            </tr>
            @foreach(var review in @Model.Movie.Reviews)
            {
                <tr>
                    <td>@review.Title</td>
                    <td>@review.Comment</td>
                    <td><a href="/Home/DeleteReview/@review.Id" class="btn btn-danger"  >Delete</a></td>
                </tr>
            }

        </table>

    </div>
    <div class="row">
        <table class="table table-hover">
            <tr>
                <th>Actors</th>
               
            </tr>
            @foreach (var actor in Model.Actors )
            {
                <tr>
                    <td>@actor.Name</td>
                    
                </tr>
            }

        </table>

    </div>
</div>


